package com.maas.util.mybatis.jpa.littlenb.conditions.plus.core.injector;

import com.maas.util.mybatis.jpa.littlenb.conditions.plus.core.mapper.Mapper;
import com.maas.util.mybatis.jpa.littlenb.conditions.plus.core.metadata.TableInfo;
import com.maas.util.mybatis.jpa.littlenb.conditions.plus.core.metadata.TableInfoHelper;
import com.maas.util.mybatis.jpa.littlenb.conditions.plus.core.toolkit.CollectionUtils;
import com.maas.util.mybatis.jpa.littlenb.conditions.plus.core.toolkit.GlobalConfigUtils;
import com.maas.util.mybatis.jpa.littlenb.conditions.plus.core.toolkit.ReflectionKit;
import org.apache.ibatis.builder.MapperBuilderAssistant;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * TableInfoInjector
 * </p>
 *
 * @author zxm
 * @date 2021/08/04 21:57
 * @since 2021/08/04 21:57
 */
public class TableInfoInjector {
    /**
     * 只处理继承com.maas.util.mybatis.jpa.littlenb.conditions.plus.mapper.mapper 的类
     *  其实不执行也可以，
     * @param builderAssistant
     * @param mapperClass
     */
    public static void inspectInject(MapperBuilderAssistant builderAssistant, Class<?> mapperClass) {
        //只处理继承com.maas.util.mybatis.jpa.littlenb.conditions.plus.mapper.mapper 的类
        Class<?> modelClass = ReflectionKit.getSuperClassGenericType(mapperClass, Mapper.class, 0);
        if (modelClass != null) {
            TableInfo tableInfo = TableInfoHelper.initTableInfo(builderAssistant, modelClass);
        }
    }
}
